1. Field of the Invention
The present invention relates to a defect detection apparatus for detecting a defect such as dust, a flaw, or dirt on a uniformly continuous background pattern of a multi-valued image acquired by capturing an image of an object surface, a defect detection method used in the defect detection apparatus, and a computer program for making a computer execute processing in the defect detection method.
2. Description of Related Art
As a conventional example, a scanning apparatus has been proposed in which an n-order approximation is performed by adopting a least square method on each line in an original image which was acquired by imaging with a digital camera and includes shading and a singular point formed by a defect such as dust, a flaw or dirt. Data from all lines are integrated to generate shading image data as flattened data, a difference between the original image data and the shading image data is calculated, and when the difference indicates a singular point that is larger than a prescribed value, the singular point is determined to be a singular point due to a defect (refer to e.g. Japanese Patent Application Laid-Open No. 2006-050356).
However, in the conventional example above, when non-periodic complex shading is generated, a user will encounter difficulty when setting an appropriate order n of an n-order approximate curve for detecting a defect, and even when a shading image is generated by using a large setting for the order n, the shading image will not match the original image. Hence there is a problem in that an approximate error occurs in the inconsistent portion and a difference due to the approximation error cannot be distinguished from a difference due to a defect portion.
In this context, Japanese Patent Application Laid-Open No. 2009-199126 discloses a defect detection apparatus that enables highly accurate detection of a defect that is no larger than a size determined by a user based on a difference image between an original multi-valued image and an enlarged image by removing defect images that are not greater than a set size from a reduced image.